<%@ page contentType="text/html;charset=UTF-8"%>
<%@ include file="/WEB-INF/views/include/taglib.jsp"%>
<html>
<head>
<title>项目查询管理</title>
<meta name="decorator" content="default" />

<script type="text/javascript">
	$(document).ready(function() {
	});
	function page(n, s) {
		$("#pageNo").val(n);
		$("#pageSize").val(s);
		$("#searchForm").submit();
		return false;
	}
</script>
</head>
<body>
	<ul class="nav nav-tabs">
		<li class="active">
			<a href="javascript:void(0)">我的项目列表</a>
		</li>
	</ul>
	<form:form id="searchForm" modelAttribute="project" action="${ctx}/crm/project/project/findProject" method="post" class="breadcrumb form-search">
		<ul class="ul-form">
			<%-- <li>
				<label>公司名：</label>
				<form:select path="customerId" id="company" style="width: 180px;">
					<form:option value="">请选择</form:option>
					<c:forEach items="${customer}" var="customer">
						<form:option value="${customer.id}">${customer.name}</form:option>
					</c:forEach>
				</form:select>
				<form:input path="name" htmlEscape="false" maxlength="100" class="input-medium"/>
			</li> --%>
			<li>
				<label>项目名：</label>
				<form:select path="name" id="project" style="width: 180px;">
					<form:option value="">请选择</form:option>
					<c:forEach items="${projects}" var="project">
						<form:option value="${project.name}">${project.name}</form:option>
					</c:forEach>
				</form:select>
			</li>
			<li class="btns">
			    <shiro:hasPermission name="project:project:findProject">
				<input id="btnSubmit" class="btn btn-primary" type="submit" value="查询" />
				</shiro:hasPermission>
			</li>
			<li class="clearfix"></li>
		</ul>
	</form:form>
	<sys:message content="${message}" />
	<table id="contentTable" style="table-layout: fixed;" class="table table-striped table-bordered table-condensed">
		<thead>
			<tr>
				<th>项目名</th>
				<th>公司名</th>
				<th>项目内容</th>
				<th>联系人</th>
				<th>跟进人</th>
				<th>录入时间</th>
				<th>状态</th>
				<th>操作</th>
			</tr>
		</thead>
		<tbody>
			<c:forEach items="${page}" var="project">
				<tr>
					<td><a href="${ctx}/crm/project/project/form?id=${project.id}">${project.name}</a></td>
					<td><a href="${ctx}/crm/findcustomer/findCustomer/form?id=${project.customerId}">${project.cname}</a></td>
					<td style="width: 100%; word-break: keep-all; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;" title="${project.content}">${project.content}</td>
					<td>${project.pcname}</td>
					<td>${project.fname}</td>
					<td>
						<fmt:formatDate value="${project.createDate}" pattern="yyyy-MM-dd HH:mm:ss" />
					</td>
					<td>${project.dname}</td>
					<td>
					 <shiro:hasPermission name="project:project:view">
					 	<a href="${ctx}/crm/project/project/delete?id=${project.id}">删除</a>
						<a href="${ctx}/crm/project/project/form?id=${project.id}">查看</a>
						</shiro:hasPermission>
					</td>
				</tr>
			</c:forEach>
		</tbody>
	</table>
	<br/>
	<c:if test="${empty page}">
		<p style="font-size: 22px; width: 150px; margin: 0px auto;">暂无项目</p>
	</c:if>
</body>
</html>